﻿//
// Copyright (C) Ashish Kaila 2011
//

using System.Windows.Controls;
using System.Windows.Input;
using MixModes.Synergy.VisualFramework.Commands;
using MixModes.Synergy.VisualFramework.ViewModels;

namespace Flipbook.ViewModels
{
    /// <summary>
    /// Designer properties view model
    /// </summary>
    public class DesignerPropertiesViewModel : ViewModelBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DesignerPropertiesViewModel"/> class.
        /// </summary>
        public DesignerPropertiesViewModel()
        {
            EditingMode = InkCanvasEditingMode.Ink;
            ChangeEditingModeCommand = new CommandBase(arg => ChangeEditingMode((InkCanvasEditingMode)arg));
        }

        /// <summary>
        /// Gets or sets the editing mode.
        /// </summary>
        /// <value>
        /// The editing mode.
        /// </value>
        public InkCanvasEditingMode EditingMode
        {
            get; 
            private set;
        }

        /// <summary>
        /// Gets the change editing mode command.
        /// </summary>
        public ICommand ChangeEditingModeCommand
        {
            get; 
            private set;
        }

        /// <summary>
        /// Changes the editing mode.
        /// </summary>
        /// <param name="mode">The mode.</param>
        private void ChangeEditingMode(InkCanvasEditingMode mode)
        {
            EditingMode = mode;
            RaisePropertyChanged(x=>EditingMode);
        }
    }
}
